Skip to content

chore(runway): cherry-pick fix: disable Branch test instance and debug mode in branch.json cp-7.71.0#27889

Merged
chloeYue merged 1 commit into
release/7.71.0from
runway-cherry-pick-7.71.0-1774385710
Mar 25, 2026
Merged

chore(runway): cherry-pick fix: disable Branch test instance and debug mode in branch.json cp-7.71.0#27889
chloeYue merged 1 commit into
release/7.71.0from
runway-cherry-pick-7.71.0-1774385710

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github Bot commented Mar 24, 2026

Description

branch.json had useTestInstance: true and debugMode: true, which
forced all builds — including production RC — to initialize the
Branch SDK against the test environment. Branch short links (e.g.
metamask.app.link/1WkF6GmE40b) are created in the live Branch
dashboard, so the test-instance SDK could never resolve them: the test
and live environments are separate databases.

This was the root cause of the "This page doesn't exist" error when
opening Branch deepview short links (e.g. from Twitter/X). The SDK
returned +clicked_branch_link: false and +non_branch_link with the
raw URL because the test environment had no record of live links.

The fix sets both values to false so the SDK uses the live key from
the native configuration (Info.plist / AndroidManifest.xml),
matching the environment where links are actually created.

Note: The same branch.json content is also present at
android/app/src/main/assets/branch.json — both platforms are affected.
This PR fixes the root config; the Android copy should also be
verified/updated.

Changelog

CHANGELOG entry: Fixed Branch.io deep links not resolving by switching
SDK from test to live environment

Related issues

Fixes:

Manual testing steps

Feature: Branch short link deep linking

  Background:
    Given I have a production RC build installed
    And the app is using the live Branch key

  Scenario: user opens a Branch short link from cold start
    Given the app is not running

    When user taps a Branch deepview link (e.g. https://metamask.app.link/1WkF6GmE40b)
    Then the app should open
    And the user should be navigated to the intended destination (e.g. Trending page)
    And the "This page doesn't exist" modal should NOT appear

  Scenario: user opens a Branch short link from warm start (app backgrounded)
    Given the app is running in the background

    When user taps a Branch deepview link
    Then the app should come to foreground
    And the user should be navigated to the intended destination

  Scenario: user opens a direct universal link (non-Branch)
    Given the app is installed

    When user taps https://link.metamask.io/trending
    Then the Trending page should open normally
    And behavior should be unchanged from before this PR

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Note

Low Risk
Low risk config-only change, but it affects deep link behavior across
builds by switching Branch initialization away from the test
environment.

Overview
Disables debugMode and useTestInstance in branch.json, ensuring
the Branch SDK initializes against the live environment rather than
the test instance.

This should restore proper resolution of production Branch short
links/deepviews that previously failed when the app was forced to use
the test Branch database.

Written by Cursor
Bugbot
for commit
33fcef1. This will update automatically
on new commits. Configure
here.

[75bef55](https://github.com/MetaMask/metamask-mobile/commit/75bef55fcaa5061fcc0178d2348a48babd483914)

…g mode in branch.json cp-7.71.0 (#27879)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

`branch.json` had `useTestInstance: true` and `debugMode: true`, which
forced **all builds** — including production RC — to initialize the
Branch SDK against the **test environment**. Branch short links (e.g.
`metamask.app.link/1WkF6GmE40b`) are created in the **live** Branch
dashboard, so the test-instance SDK could never resolve them: the test
and live environments are separate databases.

This was the root cause of the "This page doesn't exist" error when
opening Branch deepview short links (e.g. from Twitter/X). The SDK
returned `+clicked_branch_link: false` and `+non_branch_link` with the
raw URL because the test environment had no record of live links.

The fix sets both values to `false` so the SDK uses the live key from
the native configuration (`Info.plist` / `AndroidManifest.xml`),
matching the environment where links are actually created.

**Note:** The same `branch.json` content is also present at
`android/app/src/main/assets/branch.json` — both platforms are affected.
This PR fixes the root config; the Android copy should also be
verified/updated.

## **Changelog**

CHANGELOG entry: Fixed Branch.io deep links not resolving by switching
SDK from test to live environment

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: Branch short link deep linking

  Background:
    Given I have a production RC build installed
    And the app is using the live Branch key

  Scenario: user opens a Branch short link from cold start
    Given the app is not running

    When user taps a Branch deepview link (e.g. https://metamask.app.link/1WkF6GmE40b)
    Then the app should open
    And the user should be navigated to the intended destination (e.g. Trending page)
    And the "This page doesn't exist" modal should NOT appear

  Scenario: user opens a Branch short link from warm start (app backgrounded)
    Given the app is running in the background

    When user taps a Branch deepview link
    Then the app should come to foreground
    And the user should be navigated to the intended destination

  Scenario: user opens a direct universal link (non-Branch)
    Given the app is installed

    When user taps https://link.metamask.io/trending
    Then the Trending page should open normally
    And behavior should be unchanged from before this PR
```

## **Screenshots/Recordings**

### **Before**

N/A

### **After**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk config-only change, but it affects deep link behavior across
builds by switching Branch initialization away from the test
environment.
> 
> **Overview**
> Disables `debugMode` and `useTestInstance` in `branch.json`, ensuring
the Branch SDK initializes against the **live** environment rather than
the test instance.
> 
> This should restore proper resolution of production Branch short
links/deepviews that previously failed when the app was forced to use
the test Branch database.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
33fcef1. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy link
Copy Markdown
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 25, 2026
@github-actions github-actions Bot added size-XS risk-low Low testing needed · Low bug introduction risk labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The only changed file is branch.json, which is a configuration file for the Branch.io mobile SDK (used for deep linking and attribution). The changes flip two boolean flags from true to false:

  • debugMode: true → false: Disables Branch SDK debug mode (switches to production logging/behavior)
  • useTestInstance: true → false: Switches from Branch test instance to production instance

These are SDK configuration flags with no references in the application TypeScript/JavaScript codebase (grep confirmed useTestInstance has zero matches, and debugMode matches are only in an unrelated scripts/coverage-analysis.js file). This change has no impact on:

  • Application logic or UI components
  • Controllers or Engine
  • E2E test flows
  • Performance characteristics
  • Test infrastructure

This is a low-risk release preparation change (ensuring production Branch SDK settings are active). No E2E tests need to run to validate this configuration change.

Performance Test Selection:
The branch.json change only affects Branch.io SDK configuration flags (debugMode and useTestInstance). These are external SDK settings with no impact on app rendering, data loading, state management, or any performance-sensitive code paths. No performance tests are needed.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@chloeYue chloeYue merged commit 0e4683f into release/7.71.0 Mar 25, 2026
59 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.71.0-1774385710 branch March 25, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-low Low testing needed · Low bug introduction risk size-XS team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants